<?php

    if (!defined('BASEPATH'))
        exit('No direct script access allowed');

    if (!function_exists('loadClass')):

        function loadClass($filename = FALSE, $external = FALSE, $EXTERNAL_PATH = "") {
            if (!$filename):
                echo "load helper error: Please give name of class to load!";
                exit();
            endif;

            //require class
            if (!class_exists($filename))
                if (!$external)
                    require_once './' . APPPATH . 'libraries/' . $filename . '.php';
                else
                    require_once $EXTERNAL_PATH . 'libraries/' . $filename . '.php';
        }

    endif;